﻿using System;
using System.Collections.ObjectModel;

namespace AppGene.DataModel
{
    /// <summary>
    /// The collection class for LogicalTable.
    /// </summary>
    public class LogicalTableCollection
        : KeyedCollection<string, LogicalTable>
    {
        /// <summary>
        /// Creates a logical table collection instance.
        /// </summary>
        public LogicalTableCollection() 
            : base(StringComparer.OrdinalIgnoreCase) 
        { }

        /// <summary>
        /// Gets the key for a logical table instance.
        /// </summary>
        /// <param name="item">The logical table.</param>
        /// <returns>Returns the key for a logical table instance.</returns>
        protected override string GetKeyForItem(LogicalTable item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            return item.Name;
        }
    }
}

